package utils;

import java.util.UUID;

/**
 * 取号
 *
 * https://blog.csdn.net/Anumbrella/article/details/106463492
 */
public class IdUtil {

    public static void main(String[] args) {

        System.out.println(UUID.randomUUID());


        //获取一个版本3(基于名称)根据指定的字节数组的UUID。
        byte[] name = "uuid".getBytes();
        UUID uuidFromBytes = UUID.nameUUIDFromBytes(name);

        System.out.println(uuidFromBytes.toString());

        System.out.println("============"+ UUID.randomUUID());
        System.out.println(uuidFromBytes.toString());

    }
}
